home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 44
/
Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso
/
Aminet
/
comm
/
misc
/
Spitfire2.lha
/
Spitfireイ Install
/
developer
/
conduits-conduit.e
next >
Wrap
Text File
|
2000-04-29
|
3KB
|
101 lines
/* SpitfireHSM base conduit library */
OPT PREPROCESS
MODULE 'palmlink','libraries/palmlink'
MODULE 'dos/dos'
MODULE 'exec/libraries'
MODULE '*spitfireAPIconduit'
LIBRARY 'conduits.conduit',1,0,'$VER: conduits.conduit 1.0 (10.04.2000) Copyright ©1999-2000 by Ralph Torchia' IS
spit_Synchronize,
spit_ExplainError,
spit_ConduitName,
spit_ConduitAuthor,
spit_ConduitCopyright,
spit_ConduitDescription,
spit_ConduitDBName,
spit_ConduitCreatorID,
spit_ConduitDefaultAction,
spit_ConduitActions,
spit_DesktopPrg,
spit_DesktopName
PROC spit_Synchronize(mydir, palmlib:PTR TO lib, socket, action, priv)
DEF conduitpath[256]:STRING
DEF mylock=NIL
DEF error=FALSE
DEF olddir=NIL
palmlinkbase:=palmlib
StrCopy(conduitpath,mydir,ALL)
AddPart(conduitpath,'conduits',256)
IF (mylock:=Lock(conduitpath,SHARED_LOCK))=NIL
IF (mylock:=CreateDir(conduitpath))=NIL
RETURN TRUE
ENDIF
ENDIF
olddir:=CurrentDir(mylock)
SELECT action
CASE SPIT_ACTION_NOTHING /* not really need, BUT here FOR completeness */
NOP
CASE SPIT_ACTION_SYNCFILES /* synchronize your database here */
NOP
CASE SPIT_ACTION_AMIGAOVERWRITES /* copy the database TO the pilot */
NOP
CASE SPIT_ACTION_REMOTEOVERWRITES /* retrieve database from pilot */
NOP
DEFAULT
error:=TRUE /* anything not NIL IS an error */
ENDSELECT
CurrentDir(olddir)
UnLock(mylock)
ENDPROC error /* a successfull sync return NIL=0 */
PROC spit_ExplainError(buf)
StrCopy(buf, '', ALL) /* text explaination of last error */
ENDPROC
PROC spit_ConduitName() IS 'Base Conduit' /* official name of your conduit */
PROC spit_ConduitAuthor() IS 'Ralph Torchia' /* author of conduit */
PROC spit_ConduitCopyright() IS 'Copyright ©1999-2000 Ralph Torchia\nAll Rights Reserved' /* copyright notice */
PROC spit_ConduitDescription() IS 'Used for creating new conduit libraries. For development purpose only!' /* short explaination of conduit */
PROC spit_ConduitDBName() IS 'conduits.pdb' /* palm db that conduit syncs with */
PROC spit_ConduitCreatorID() IS 0 /* get your conduit id from Palm Computing */
PROC spit_ConduitDefaultAction() IS SPIT_ACTION_SYNCFILES /* default action that conduit performs */
PROC spit_ConduitActions(action1, action2, action3, action4, action5, action6)
StrCopy(action1, 'Synchronize files' , ALL) /* These four should be usually supported */
StrCopy(action2, 'Amiga overwrites handheld', ALL)
StrCopy(action3, 'Handheld overwrites Amiga', ALL)
StrCopy(action4, 'Do nothing' , ALL)
StrCopy(action5, '' , ALL)
StrCopy(action6, '' , ALL)
ENDPROC
PROC spit_DesktopPrg() IS 'Base Conduit.desktop'
PROC spit_DesktopName() IS 'Base Conduit'
PROC main() IS EMPTY /* startup code for when library is opened */
PROC close() IS EMPTY /* ending code for when library is closed */